<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en"><head>


  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>applinodocumentation [Applino]</title>
  

  <meta name="generator" content="DokuWiki Release 2007-06-26b">
<meta name="robots" content="noindex,nofollow">
<meta name="date" content="2008-03-26T14:54:51+0200">
<meta name="keywords" content="applinodocumentation">
<link rel="search" type="application/opensearchdescription+xml" href="http://www.applino.com/wiki/lib/exe/opensearch.php" title="Applino">
<link rel="start" href="http://www.applino.com/wiki/">
<link rel="contents" href="http://www.applino.com/wiki/doku.php?id=applinodocumentation&amp;do=index" title="Index">
<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="http://www.applino.com/wiki/feed.php">
<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="http://www.applino.com/wiki/feed.php?mode=list&amp;ns=">
<link rel="alternate" type="text/html" title="Plain HTML" href="http://www.applino.com/wiki/doku.php?do=export_xhtml&amp;id=applinodocumentation">
<link rel="alternate" type="text/plain" title="Wiki Markup" href="http://www.applino.com/wiki/doku.php?do=export_raw&amp;id=applinodocumentation">
<link rel="stylesheet" media="all" type="text/css" href="index_files/css.css">
<link rel="stylesheet" media="screen" type="text/css" href="index_files/css_003.css">
<link rel="stylesheet" media="print" type="text/css" href="index_files/css_002.css">
<script type="text/javascript" charset="utf-8" src="index_files/js.php"></script>

  <link rel="shortcut icon" href="http://www.applino.com/wiki/lib/tpl/default/images/favicon.ico"></head><body>
<div class="dokuwiki">
  
  <div class="stylehead">

    <div class="header">
      <div class="pagename">
        [[<a href="http://www.applino.com/wiki/doku.php?id=applinodocumentation&amp;do=backlink">applinodocumentation</a>]]
      </div>
      <div class="logo">
        <a href="http://www.applino.com/wiki/doku.php?id=" name="dokuwiki__top" id="dokuwiki__top" accesskey="h" title="[ALT+H]">Applino</a>      </div>

      <div class="clearer"></div>
    </div>

    
    <div class="bar" id="bar__top">
      <div class="bar-left" id="bar__topleft">
        <form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="rev" value="" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit this page" class="button" accesskey="e" title="Edit this page [ALT+E]" type="submit"></div></form>        <form class="button" method="get" action="/wiki/doku.php"><div class="no"><input name="do" value="revisions" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Old revisions" class="button" accesskey="o" title="Old revisions [ALT+O]" type="submit"></div></form>      </div>

      <div class="bar-right" id="bar__topright">
        <form class="button" method="get" action="/wiki/doku.php"><div class="no"><input name="do" value="recent" type="hidden"><input name="id" value="" type="hidden"><input value="Recent changes" class="button" accesskey="r" title="Recent changes [ALT+R]" type="submit"></div></form>        <form action="/wiki/doku.php?id=" accept-charset="utf-8" class="search" id="dw__search"><div class="no"><input name="do" value="search" type="hidden"><input id="qsearch__in" accesskey="f" name="id" class="edit" title="[ALT+F]" type="text"><input value="Search" class="button" title="Search" type="submit"><div id="qsearch__out" class="ajax_qsearch JSpopup"></div></div></form>&nbsp;
      </div>

      <div class="clearer"></div>
    </div>

        <div class="breadcrumbs">
      Trace: <span class="bcsep">»</span> <span class="curid"><a href="http://www.applino.com/wiki/doku.php?id=applinodocumentation" class="breadcrumbs" title="applinodocumentation">applinodocumentation</a></span>          </div>
    
    
  </div>
  
  
  <div class="page">
    <!-- wikipage start -->
    <div class="toc">
<div style="cursor: pointer;" class="tocheader toctoggle" id="toc__header"><span style="cursor: pointer;" class="toc_close" id="toc__toggle"><span>−</span></span>Table of Contents</div>
<div id="toc__inside">

<ul class="toc">
<li class="level1"><div class="li"><span class="li"><a href="#applino" class="toc">Applino</a></span></div>
<ul class="toc">
<li class="level2"><div class="li"><span class="li"><a href="#introduction" class="toc">Introduction</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#terminology" class="toc">Terminology</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#installation" class="toc">Installation</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#running_applini" class="toc">Running Applini</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#the_applino_container" class="toc">The Applino Container</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#developing_an_applino" class="toc">Developing an Applino</a></span></div></li>
<li class="level2"><div class="li"><span class="li"><a href="#building_applino" class="toc">Building Applino</a></span></div></li></ul>
</li></ul>
</div>
</div>



<h1><a name="applino" id="applino">Applino</a></h1>
<div class="level1">

<p>
 <strong><a href="http://www.applino.com/" class="urlextern" title="http://www.applino.com/" rel="nofollow">http://www.applino.com/</a></strong>
</p>

</div>
<div class="secedit"><form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="lines" value="1-52" type="hidden"><input name="rev" value="1206536091" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit" class="button" title="Applino" type="submit"></div></form></div>
<h2><a name="introduction" id="introduction">Introduction</a></h2>
<div class="level2">
<ul>
<li class="level1"><div class="li"> An Applino is to the desktop what a servlet is to the server.</div>
</li>
<li class="level1"><div class="li"> Applino provides and environment for running multiple Java desktop applications within a single JVM.</div>
</li>
<li class="level1"><div class="li"> The Applino environment runs as a taskbar icon and starts when the user logs into their computer.</div>
</li>
<li class="level1"><div class="li"> Applini (Applino applications) are
similar to servlets in that they contain runtime descriptors and have
their life cycles dictated by the Applino container. </div>
</li>
</ul>

<p> Most Java developers realise that it is inefficient to instantiate
a separate JVM for each Java application running on a user's computer.
This involves a significant extra start-up time and is wasteful of
memory. Unfortunately, due to the need to segregate the effects of one
application from another there hasn't been any choice.
</p>

<p>On the server side however, much progress has been made in the area
of Java Application Servers which are able to run multiple web
applications within the same JVM. The level of intra application
protection is so good that several hosting companies provide shared
hosting where users host their web applications in the same JVM as
other users.
</p>

<p>The idea behind this project is simple: take the
compartmentalisation technology which has been developed for servlets
and reapply it to the desktop space. This has proven to be exceedingly
simple as concepts such as context life cycles and hierarchical class
loaders map perfectly to the requirements of a mono JVM desktop
environment.
</p>

<p>
Typically <em>porting</em> an existing application to the Applino
environment is trivial. It is simply a matter of ensuring that it is
properly started when instructed and properly terminated. The initial
window for the hosted application will also be provided by the Applino
container (so that it can control events such as window closing).
</p>

<p>As a demonstration of how easy it is to port existing applications,
we have already provided Applino versions of all the JFC example
applications from the <acronym title="Java Development Kit">JDK</acronym>.
</p>

</div>
<div class="secedit"><form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="lines" value="53-2029" type="hidden"><input name="rev" value="1206536091" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit" class="button" title="Introduction" type="submit"></div></form></div>
<h2><a name="terminology" id="terminology">Terminology</a></h2>
<div class="level2">
<table class="inline">
	<tbody><tr>
		<td> Applino Container / Runner </td><td> The main “container” application running in the taskbar. </td>
	</tr>
	<tr>
		<td> Applin<strong>o</strong> <sub>(singular)</sub> Applin<strong>i</strong> <sub>(plural)</sub></td><td> The hosted applications. This is similar to an applet or servlet. </td>
	</tr>
</tbody></table>

</div>
<div class="secedit"><form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="lines" value="2030-2282" type="hidden"><input name="rev" value="1206536091" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit" class="button" title="Terminology" type="submit"></div></form></div>
<h2><a name="installation" id="installation">Installation</a></h2>
<div class="level2">

<p>
 Unzip the Applino distribution and run <code>install.bat</code>. This will copy the required files to <code>%ProgramFiles%\Applino</code> and create a link in the ”<code>Start Menu\Programs\Startup</code>” causing the Applino container to be run at startup. The container is visible in the task tray (as a green dot).
</p>

</div>
<div class="secedit"><form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="lines" value="2283-2600" type="hidden"><input name="rev" value="1206536091" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit" class="button" title="Installation" type="submit"></div></form></div>
<h2><a name="running_applini" id="running_applini">Running Applini</a></h2>
<div class="level2">

<p>
 Simply drag the Applino over the <code>Applini</code> folder on
your desktop (i.e. to move the Applino to the correct location). It
should now appear in the list of available Applini in the task tray
icon.
</p>

</div>
<div class="secedit"><form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="lines" value="2601-2827" type="hidden"><input name="rev" value="1206536091" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit" class="button" title="Running Applini" type="submit"></div></form></div>
<h2><a name="the_applino_container" id="the_applino_container">The Applino Container</a></h2>
<div class="level2">

<p> As mentioned previously, Applini are in many ways similar to
servlets. For this reason it was decided to base the Applino container
on an existing servlet container. The <a href="http://www.mortbay.org/" class="urlextern" title="http://www.mortbay.org/" rel="nofollow">Jetty</a> container was chosen because of the fact that it is both lightweight and programmatically configurable (i.e. embeddable).
</p>

<p>
The <code>ApplinoContainer</code> class is simply a container class which configures Jetty and starts the container running in the task tray. 
</p>

<p>
The <code>ApplinoDeployer</code> class is the most involved modification to the servlet container in that it scans the <code>applini</code> sub-directory for Applini (files with a <code>.aar</code> sufix: i.e. <strong>A</strong>pplication <strong>Ar</strong>chive) and creates a new <code>ApplinoContext</code> for each Applino which is found. Expanded <code>.aar</code> archives are also supported. When a new <code>ApplinoContext</code> is instantiated or destroyed (by deleting the Applino file) the corresponding entry is removed from the task tray icon.
</p>

<p>
When a user selects the name of an Applino from the task tray icon, the corresponding Applino is started by calling <code>startApplino()</code>.
</p>

<p>
An <code>ApplinoContext</code> is simply an extension of a Jetty <code>WebAppContext</code>
which also deals with updating the task tray icon when Applini are
started and stopped. In addition it frees any resources associated with
an Applino when it is stopped and creates an <code>ApplinoFrame</code> for the Applino to use for displaying any graphical output.
</p>

</div>
<div class="secedit"><form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="lines" value="2828-4277" type="hidden"><input name="rev" value="1206536091" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit" class="button" title="The Applino Container" type="submit"></div></form></div>
<h2><a name="developing_an_applino" id="developing_an_applino">Developing an Applino</a></h2>
<div class="level2">

<p>
 Most Java applications or applets can be easily converted to Applini. The main things to note are: 
</p>
<ul>
<li class="level1"><div class="li"> <strong>Adapt program lifecycle to support the <code>contextInitialized</code> and <code>contextDestroyed</code> methods.</strong> Typically, code from the <code>main</code> method of an application or the <code>init</code> method of an applet will go in the <code>contextInitialized</code> method. <code>contextDestroyed</code>
should be used to free up any resources such as files. Other objects
attached to the main Applino class will be garbage collected when the
Applino is destroyed.</div>
</li>
</ul>
<ul>
<li class="level1"><div class="li"> <strong>Make use of the supplied <code>ApplinoFrame</code>.</strong> The main presentation window for your application can be retreived using the following code: <pre class="code java">ApplinoFrame frame = <span class="br0">(</span>ApplinoFrame<span class="br0">)</span>sc.<span class="me1">getAttribute</span><span class="br0">(</span><span class="st0">"frame"</span><span class="br0">)</span>;</pre>
<p>
 An <code>ApplinoFrame</code> is effectively just a <code>JFrame</code>
(with an overridden window close method). As most Applications and all
Applets use JFrames (or a subclass) for display purposes, adapting the
program to use the supplied <code>JFrame</code> should be trivial.
</p>
</div>
</li>
</ul>

<p> In any case, we have provided a vast array of examples to get you
started and show you clearly how easy it is to transform an existing
application. Look in particular at the <code>/examples</code> and <code>/3rdparty</code> sub-directories.
</p>

<p>
An example Applino is presented below:
</p>
<pre class="code java"><span class="kw2">package</span> com.<span class="me1">applino</span>.<span class="me1">example</span>;
&nbsp;
<span class="co2">import com.applino.ApplinoFrame;</span>
<span class="co2">import javax.servlet.*;</span>
&nbsp;
<span class="kw2">public</span> <span class="kw2">class</span> SimpleApplino <span class="kw2">implements</span> ServletContextListener
<span class="br0">{</span>
    <span class="kw2">public</span> <span class="kw4">void</span> contextInitialized<span class="br0">(</span>ServletContextEvent event<span class="br0">)</span>
    <span class="br0">{</span>
        ServletContext sc = event.<span class="me1">getServletContext</span><span class="br0">(</span><span class="br0">)</span>;
&nbsp;
        <span class="kw2">try</span>
        <span class="br0">{</span>
            ApplinoFrame frame = <span class="br0">(</span>ApplinoFrame<span class="br0">)</span>sc.<span class="me1">getAttribute</span><span class="br0">(</span><span class="st0">"frame"</span><span class="br0">)</span>;
            frame.<span class="me1">setSize</span><span class="br0">(</span><span class="nu0">300</span>, <span class="nu0">300</span><span class="br0">)</span>;
            frame.<span class="me1">center</span><span class="br0">(</span><span class="br0">)</span>;
            frame.<span class="me1">setVisible</span><span class="br0">(</span><span class="kw2">true</span><span class="br0">)</span>;
        <span class="br0">}</span>
        <span class="kw2">catch</span><span class="br0">(</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AException+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span class="kw3">Exception</span></a> e<span class="br0">)</span>
        <span class="br0">{</span>
            e.<span class="me1">printStackTrace</span><span class="br0">(</span><span class="br0">)</span>;
        <span class="br0">}</span>
    <span class="br0">}</span>
&nbsp;
    <span class="kw2">public</span> <span class="kw4">void</span> contextDestroyed<span class="br0">(</span>ServletContextEvent event<span class="br0">)</span>
    <span class="br0">{</span>
        ServletContext sc = event.<span class="me1">getServletContext</span><span class="br0">(</span><span class="br0">)</span>;
        <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;bntI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">(</span><span class="st0">"Context destroyed..."</span><span class="br0">)</span>;
    <span class="br0">}</span>
<span class="br0">}</span></pre>
</div>
<div class="secedit"><form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="lines" value="4278-6351" type="hidden"><input name="rev" value="1206536091" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit" class="button" title="Developing an Applino" type="submit"></div></form></div>
<h2><a name="building_applino" id="building_applino">Building Applino</a></h2>
<div class="level2">

<p>
 Three separate build files are provided with the Applino distribution (in the <code>/ant</code> sub-directory): 
</p>
<ul>
<li class="level1"><div class="li"> <code>build.xml</code> is the main Ant file for building the actual Applino container.</div>
</li>
<li class="level1"><div class="li"> <code>examples.xml</code> is used for building the bundled (core) example Applini.</div>
</li>
<li class="level1"><div class="li"> <code>3rdparty.xml</code> is used for building the 3rd party (Sun) Applini (converted from the JFC example applications bundled with the <acronym title="Java Development Kit">JDK</acronym>).</div>
</li>
</ul>

</div>
<div class="secedit"><form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="lines" value="6352-" type="hidden"><input name="rev" value="1206536091" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit" class="button" title="Building Applino" type="submit"></div></form></div>
    <!-- wikipage stop -->
  </div>

  <div class="clearer">&nbsp;</div>

  
  <div class="stylefoot">

    <div class="meta">
      <div class="user">
              </div>
      <div class="doc">
        applinodocumentation.txt · Last modified: 2008/03/26 14:54 by 15.219.233.71      </div>
    </div>

   
    <div class="bar" id="bar__bottom">
      <div class="bar-left" id="bar__bottomleft">
        <form class="button" method="post" action="/wiki/doku.php"><div class="no"><input name="do" value="edit" type="hidden"><input name="rev" value="" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Edit this page" class="button" accesskey="e" title="Edit this page [ALT+E]" type="submit"></div></form>        <form class="button" method="get" action="/wiki/doku.php"><div class="no"><input name="do" value="revisions" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Old revisions" class="button" accesskey="o" title="Old revisions [ALT+O]" type="submit"></div></form>      </div>
      <div class="bar-right" id="bar__bottomright">
                                <form class="button" method="get" action="/wiki/doku.php"><div class="no"><input name="do" value="login" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Login" class="button" title="Login" type="submit"></div></form>        <form class="button" method="get" action="/wiki/doku.php"><div class="no"><input name="do" value="index" type="hidden"><input name="id" value="applinodocumentation" type="hidden"><input value="Index" class="button" accesskey="x" title="Index [ALT+X]" type="submit"></div></form>        <a class="nolink" href="#dokuwiki__top"><input class="button" value="Back to top" onclick="window.scrollTo(0, 0)" title="Back to top" type="button"></a>&nbsp;
      </div>
      <div class="clearer"></div>
    </div>

  </div>

</div>

<div class="footerinc">
  <a href="http://www.applino.com/wiki/feed.php" title="Recent changes RSS feed"><img src="index_files/button-rss.png" alt="Recent changes RSS feed" height="15" width="80"></a>

  <a href="http://creativecommons.org/licenses/by-nc-sa/2.0/" rel="license" title="Creative Commons License"><img src="index_files/button-cc.gif" alt="Creative Commons License" height="15" width="80"></a>

  <a href="https://www.paypal.com/xclick/business=andi%40splitbrain.org&amp;item_name=DokuWiki+Donation&amp;no_shipping=1&amp;no_note=1&amp;tax=0&amp;currency_code=EUR&amp;lc=US" title="Donate"><img src="index_files/button-donate.gif" alt="Donate" height="15" width="80"></a>

  <a href="http://www.php.net/" title="Powered by PHP"><img src="index_files/button-php.gif" alt="Powered by PHP" height="15" width="80"></a>

  <a href="http://validator.w3.org/check/referer" title="Valid XHTML 1.0"><img src="index_files/button-xhtml.png" alt="Valid XHTML 1.0" height="15" width="80"></a>

  <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS"><img src="index_files/button-css.png" alt="Valid CSS" height="15" width="80"></a>

  <a href="http://wiki.splitbrain.org/wiki:dokuwiki" title="Driven by DokuWiki"><img src="index_files/button-dw.png" alt="Driven by DokuWiki" height="15" width="80"></a>



<!--

<rdf:RDF xmlns="http://web.resource.org/cc/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
   <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
   <license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/2.0/" />
</Work>

<License rdf:about="http://creativecommons.org/licenses/by-nc-sa/2.0/">
   <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
   <permits rdf:resource="http://web.resource.org/cc/Distribution" />
   <requires rdf:resource="http://web.resource.org/cc/Notice" />
   <requires rdf:resource="http://web.resource.org/cc/Attribution" />
   <prohibits rdf:resource="http://web.resource.org/cc/CommercialUse" />
   <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
   <requires rdf:resource="http://web.resource.org/cc/ShareAlike" />
</License>

</rdf:RDF>

-->


</div>

<div class="no"><img src="index_files/indexer.gif" alt="" height="1" width="1"></div>
</body></html>